﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;


namespace Logic.SocialNetworks
{
	/// <summary>
	/// Summary description for TwitterConfig
	/// </summary>
	public class TwitterConfig : Social.Twitter.ITwitterConfig
	{

		#region ITwitterConfig Members

		public string ConsumerKey
		{
			get { return ConfigurationManager.AppSettings["TwitterConsumerKey"]; }
		}

		public string ConsumerSecret
		{
			get { return ConfigurationManager.AppSettings["TwitterConsumerSecret"]; }
		}

		public string AccessToken { get; set; }

		public string AccessTokenSecret { get; set; }

		public string RedirectUrl
		{
			get { return ""; }
		}

		public void SaveAccessToken()
		{
			int accountID;
			int.TryParse(HttpContext.Current.Request["ID"], out accountID);
			Logic.BusinessLogic.Accounts.UpdateTwToken(accountID, AccessToken, AccessTokenSecret);
		}
		#endregion

	}
}